package test;

public class Student {
    private String id;
    private String name;
    private String gender;
    private Course course;

    public Student(String id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
    }

    public void setCourse(Course course) {
        this.course = course;
    }

    // 打印课表
    public void printCourseSchedule() {
        if (course != null) {
            System.out.println("=====" + name + "的课表=====");
            System.out.println("课程编号：" + course.getId());
            System.out.println("课程名称：" + course.getName());
            System.out.println("上课地点：" + course.getLocation());
            System.out.println("上课时间：" + course.getTime());
            System.out.println("授课教师ID：" + course.getTeacherId());
            System.out.println("=================");
        } else {
            System.out.println(name + "暂无选课记录");
        }
    }

    public String getId() { return id; }
    public void setId(String id) { this.id = id; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getGender() { return gender; }
    public void setGender(String gender) { this.gender = gender; }
}
